﻿using SelfMadeMillionaire.Core.Entities;
using SelfMadeMillionaire.Core.Specifications;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace SelfMadeMillionaire.Core.Repositories
{
	public interface IRepository<T> where T : BaseEntity
	{
		T Get(int id);
        T Get(Expression<Func<T, bool>> predicate);

		T Add(T entity);
		T Update(T entity);

        IEnumerable<T> GetAll();
        IQueryable<T> GetAll(Expression<Func<T, bool>> predicate);
        
		IEnumerable<T> GetList(ISearchSpecification<T> specification);
		void Remove(int id);
		void Commit();
	}

}
